//
//  WelcomeViewController.swift
//  sinaweibo
//
//  Created by IZEN on 16/3/13.
//  Copyright © 2016年 IZEN. All rights reserved.
//

import UIKit
import SnapKit
class WelcomeViewController: UIViewController {
    
    override func loadView() {
        view = backImageView
    }
    
    override func viewDidLoad() {
       super.viewDidLoad()
        setupUI()
    }
    
    
    private func setupUI() {
        
        view.addSubview(iconImageView)
        view.addSubview(welcomeLabel)
        
        iconImageView.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(view.snp_centerX)
            make.bottom.equalTo(view.snp_bottom).offset(-180)
        }
        
        welcomeLabel.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(view.snp_centerX)
            make.top.equalTo(iconImageView.snp_bottom).offset(16)
        }
        
    
    }
    
    private lazy var backImageView = UIImageView(image: UIImage(named: "ad_background"))
    private lazy var iconImageView = UIImageView(image: UIImage(named: "avatar_default_big"))
    
    private lazy var welcomeLabel : UILabel = {
        let l = UILabel()
        l.text = (UserAccount.shareAccount.name ?? "") + "  欢迎回来"
        l.textColor = UIColor.darkGrayColor()
        l.font = UIFont.systemFontOfSize(14)
        l.sizeToFit()
        return l
    }()
    

}
